﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Team4Mock.Entity
{
    public class TownEntity
    {
        private int countyID;
        private string townName;
        public TownEntity()
        { }
        public TownEntity(int countyID, string townName)
        {
            this.countyID = countyID;
            this.townName = townName;
        }

        public int CountyID
        {
            get { return this.countyID; }
            set
            {
                if (value == 0)
                    throw new Exception("countyID not allow nullvalue.");
                this.countyID = value;
            }
        }
        public string TownName
        {
            get { return this.townName; }
            set
            {
                if (value == null)
                    throw new Exception("townName not allow nullvalue.");
                this.townName = value;
            }
        }
    }
}